<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>心田花开--温故知新计划</title>
    <!--<link rel="stylesheet" href="reset.css">-->
    <style>
        body{background: white}
        table{width:1128px;margin:0 auto;font-size:20px;border-collapse:separate;border-spacing:10px 5px;}
        table th{border-radius:12px;background:#f3f3f3;color:#333;border:3px solid #1e2d40;line-height:60px;padding:0 20px;}
        table th:first-child{width:150px;line-height:60px;}
        table td{font-size: 40px}
        table td.btn-td{background:#f0a8d3;font-size: 20px}
        table td.btn-td span{color:#fff;}
        table td.btn-td{cursor: pointer}
        table td.btn-td:hover{background:#f189c7;font-weight: bold}
        table td{border-radius:12px;background:#fbebf5;border:3px solid #1e2d40;color:#333;text-align:center;vertical-align:middle;padding:11px 10px;line-height:1.5;}
        a{text-decoration: none}
        img{width: 1128px;}
        .banner{text-align: center;}
        .space{
            height: 24px;
        }
    </style>
</head>
<body>
<div id="container">
    <div class="banner">
        <img src="images/xthkzxbg.jpg" alt="">
    </div>
    <table id="course-list">
        <thead>
            <tr>
                <th>年级</th>
                <th>课程</th>
            </tr>
        </thead>
    </table>
</div>
</body>
<script>
    function relocation(address) {
        window.location.href = address
    }
    var plans = [
        {
            grade: '二年级',
            course: [
                {
                    title: '情商语文辅导课Ⅰ',
                    time: '9月16日 14:30-15:30',
                    address: '//www.xthkzx.com/open/course/107'
                },
                {
                    title: '情商语文辅导课Ⅱ',
                    time: '10月7号 14:30-15:30',
                    address: '//www.xthkzx.com/course/571'
                }
            ]
        },
        {
            grade: '三年级',
            course: [
                {
                    title: '情商语文辅导课Ⅰ',
                    time: '10月14号 15:30—16:50',
                    address: '//www.xthkzx.com/course/584'
                }
            ]
        },
        {
            grade: '四年级',
            course: [
                {
                    title: '情商语文辅导课Ⅰ',
                    time: '9月16日 13:00-14:30',
                    address: '//www.xthkzx.com/open/course/108'
                },
                {
                    title: '情商语文辅导课Ⅱ',
                    time: '10月7号 13:00-14:30',
                    address: '//www.xthkzx.com/course/570'
                }
            ]
        },
        {
            grade: '五年级',
            course: [
                {
                    title: '情商语文辅导课Ⅰ',
                    time: '9月23日 17:00-18:00',
                    address: '//www.xthkzx.com/course/559'
                },
                {
                    title: '情商语文辅导课Ⅱ',
                    time: '10月14日 17:00—18:00',
                    address: '//www.xthkzx.com/course/585'
                }
            ]
        },
        {
            grade: '六年级',
            course: [
                {
                    title: '情商语文辅导课Ⅰ',
                    time: '9月23日 10:30-11:30',
                    address: 'http://www.xthkzx.com/course/560'
                },
                {
                    title: '情商语文辅导课Ⅱ',
                    time: '10月13日 16:30—17:30',
                    address: '//www.xthkzx.com/course/583'
                }
            ]
        },
        {
            grade: '七年级',
            course: [
                {
                    title: '情商语文辅导课Ⅰ',
                    time: '9月23日 14:00-15:00',
                    address: 'http://www.xthkzx.com/course/561'
                },
                {
                    title: '情商语文辅导课Ⅱ',
                    time: '10月14日 14:00—15:00',
                    address: '//www.xthkzx.com/course/586'
                }
            ]
        }
    ]
    var length = plans.length
    var str = '<tbody>'
    for (var i = 0; i < length; i++) {
        var gradeInfo = plans[i]
        var courseList = gradeInfo.course
        var courseLength = courseList.length
        var functionStr = 'relocation(' + "'" + courseList[0].address + "'" + ')'
        str += '<tr><td rowspan="' + courseLength + '">' + gradeInfo.grade + '</td><td class="btn-td" onclick="' + functionStr + '"><span>'
            + courseList[0].title + '(' + courseList[0].time + ')</span></td></tr>'
        for (var j = 1; j < courseLength; j++) {
            functionStr = 'relocation(' + "'" + courseList[j].address + "'" + ')'
            str += '<tr><td class="btn-td" onclick="' + functionStr + '"><span>'
                + courseList[j].title + '(' + courseList[j].time + ')</span></td></tr>'
        }
        str += '<tr class="space"><tr>'
    }
    str += '</tbody>'
    document.getElementById('course-list').innerHTML += str
</script>
</html>